<template>
  <div>
    <el-container>
      <el-header>
        
        <el-menu 
          router  
          :default-active="activeIndex2" 
          class="el-menu-demo" 
          mode="horizontal" 
          @select="handleSelect" 
          background-color="#ee9c53"     
          text-color="black" 
          active-text-color="#ffd04b"
        >
          <el-menu-item index="">
            
            <div class="logo-container">
        <img
          src="https://img0.baidu.com/it/u=2631990995,2997068474&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=707" 
          alt="Logo"
          class="logo"
        />
        <span class="logo-text">小农旅社吧</span>
      </div>
           </el-menu-item>
           <el-menu-item index="/c/bestSelling">农宿优品</el-menu-item>
           <el-menu-item index="/c/homestay">民宿</el-menu-item>
          <el-menu-item index="/c/market">商城</el-menu-item>
          <el-menu-item index="/c/consumerblog">用户博客</el-menu-item>
          <el-menu-item index="/c/merchantblog">商家博客</el-menu-item>
         
          <el-avatar style="margin-top: 10px; margin-left:700px;"   size="medium" :src="avatarurl"></el-avatar>
          <el-link href="/#/login" style="margin-left:10px; ">退出登录<i class="el-icon-error el-icon--right"></i></el-link>
        </el-menu>
    
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
      <el-footer class="footer">
        <div style="margin-top: 10px; margin-left: 1200px;">
        <span>&copy; 2024 小农旅社</span>
        <div>
          <el-link href="#" style="margin-right: 10px;" type="text">关于我们</el-link>

          <el-link href="#"  style="margin-right: 10px;" type="text">帮助中心</el-link>

          <el-link href="#" type="text">隐私政策</el-link>
        </div>
      </div>
    </el-footer>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      avatarurl:JSON.parse(localStorage.getItem('currentUser')).avatar,
      activeIndex2: '/home/head' // 设置默认激活的菜单项
    };
  },
  mounted(){
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  },
};
</script>

<style scoped>
.el-row {
  margin-bottom: 20px;
}

.el-row:last-child {
  margin-bottom: 0;
}

.el-col {
  border-radius: 4px;
}

.el-menu-demo {
  background-color: #ee9c53 !important; /* 强制设置背景颜色 */
}

.el-header {
  background-color: transparent; /* 确保 header 背景透明 */
}
.footer{
  background-color: #ee9c53 !important; /* 强制设置背景颜色 */
}

/* 去除虚线 */
.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  width: 40px;
  height: 40px;
}

</style>